ABOUTDEVELOPERS |
SpatialStream® Code Examples
Wetlands Determination
This example uses the GetGeocode functional component, and illustrates one of the interactive mapping features you can implement using the full parcel geometry results from the GetGeocode functional component. Here, the address, city, state and zipcode of a location are passed into the geocoding engine using GetGeocode, and depending on the type of result a wetland determination is made. The result will be either in a wetland, out of a wetland or undetermined if wetland data does not exist for an area. GetGeocode
layer = new Dmp.Layer.TileLayer("wetland", "SS", {
antiAlias: true });layer.addChild("poly", "SS.Hazards.Wetlands/Wetlands", "", { zIndex: 2, zoomRange: { }); min: 15, max: 19 } map.addEntity(layer); // add the parcel layer to the map layer = new Dmp.Layer.TileLayer("Parcel", "SS", { antiAlias: true });layer.addChild("Parcels", "samplesite.dmp/ParcelTiles", "", { zIndex: 2, zoomRange: { }); min: 15, max: 19 } map.addEntity(layer); // add the parcel layer to the map layer = new Dmp.Layer.TileLayer("Parcel", "SS", { antiAlias: true });layer.addChild("Parcels", "samplesite.dmp/Parcels", "samplesite.dmp.Styles.Parcels/Default.sld.xml", { zIndex: 2, zoomRange: { }); min: 20, max: 20 } map.addEntity(layer); //---------------- var url = "GetGeocode.aspx?"; url += "&address=" + document.getElementById("address").value; url += "&city=" + document.getElementById("city").value; url += "&state=" + document.getElementById("state").value; url += "&zip=" + document.getElementById("zip").value; url += "&fields=*,[resource](*),WETLANDS(*),WETLANDSMETA(*)"; url += "&links="+ encodeURIComponent(JSON.stringify(links)); url += "&datasource=PARCELS,STREET_CENTERLINE"; url += "&showschema=false"; Dmp.Env.Connections["SS"].getJson(url, geocodeSuccess, geocodeFailure); //---------------- var url = "GetByKey.aspx?"; url += "&dataSource=samplesite.dmp/Parcels"; url += "&keyName=locid"; url += "&keyValue=" + locid; url += "&fields=*,WETLANDS(*),WETLANDSMETA(*)"; url += "&links="+ encodeURIComponent(JSON.stringify(links)); url += "&showschema=false"; Run Sample Back To Index |